// json_to_dart 自动生成模型类 https://javiercbk.github.io/json_to_dart/

class FocusModel {
  late List<FocusItemModel> product;

  FocusModel({required this.product});

  FocusModel.fromJson(Map<String, dynamic> json) {
    if (json['product'] != null) {
      product = [];
      json['product'].forEach((v) {
        product.add(new FocusItemModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['product'] = this.product.map((v) => v.toJson()).toList();
    return data;
  }
}

class FocusItemModel {
  late int pid;
  late int carId;
  late String indexTitle;
  late String indexDetails;
  late String indexImg;
  late double indexPrice;
  late String indexHref;
  late int indexSeqRecommended;
  late int indexSaleNew;
  late int indexSeqTopSale;
  late String indexOtherTitle;
  late String indexPicurl;
  late int indexStatus;

  FocusItemModel(
      {required this.pid,
      required this.carId,
      required this.indexTitle,
      required this.indexDetails,
      required this.indexImg,
      required this.indexPrice,
      required this.indexHref,
      required this.indexSeqRecommended,
      required this.indexSaleNew,
      required this.indexSeqTopSale,
      required this.indexOtherTitle,
      required this.indexPicurl,
      required this.indexStatus});

  FocusItemModel.fromJson(Map<String, dynamic> json) {
    pid = json['pid'];
    carId = json['car_id'];
    indexTitle = json['index_title'];
    indexDetails = json['index_details'];
    indexImg = json['index_img'];
    indexPrice = json['index_price'];
    indexHref = json['index_href'];
    indexSeqRecommended = json['index_seq_recommended'];
    indexSaleNew = json['index_sale_new'];
    indexSeqTopSale = json['index_seq_top_sale'];
    indexOtherTitle = json['index_other_title'];
    indexPicurl = json['index_picurl'];
    indexStatus = json['index_status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['pid'] = this.pid;
    data['car_id'] = this.carId;
    data['index_title'] = this.indexTitle;
    data['index_details'] = this.indexDetails;
    data['index_img'] = this.indexImg;
    data['index_price'] = this.indexPrice;
    data['index_href'] = this.indexHref;
    data['index_seq_recommended'] = this.indexSeqRecommended;
    data['index_sale_new'] = this.indexSaleNew;
    data['index_seq_top_sale'] = this.indexSeqTopSale;
    data['index_other_title'] = this.indexOtherTitle;
    data['index_picurl'] = this.indexPicurl;
    data['index_status'] = this.indexStatus;
    return data;
  }
}
